fix: hide abstract DCIM generics from auto-menu to drop duplicate entries#73
Open
fix: hide abstract DCIM generics from auto-menu to drop duplicate entries#73
Conversation
Both abstract generics defaulted into the auto-menu while their concrete descendants (DcimFiberMapping/DcimCableMapping/DcimWSSConnect, and DcimOpticalNode) already render their own top-level entries with no menu_placement nesting them. The generic listings duplicated the same records, so this aligns them with DcimGenericDevice and the other hidden DCIM generics. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary —
include_in_menucleanup onic-fix-display-menuWhat changed
Commit
a2c51cd—base/dcim.ymlAdded
include_in_menu: falseto theDcimGenericDevicegeneric.Commit
0143c59—experimental/optical_transport/optical_transport.ymlFlipped
include_in_menu: true→falseon two generics:DcimChannelMapping(line 26)DcimOpticalDevice(line 69)Why
All three are abstract generics whose concrete descendants already render their own top-level menu entries without nesting via
menu_placement. That means the Infrahub UI was showing two top-level entries pointing at the same records:DcimGenericDeviceDcimDevice(rendered as "Network Device")DcimChannelMappingDcimFiberMapping,DcimCableMapping,DcimWSSConnectDcimOpticalDeviceDcimOpticalNodeFunctional duplicates — clicking either entry surfaced the same data. Hiding the generic eliminates the duplicate without losing anything, since the descendants are the only data carriers.
Consistency rationale
The
base/dcim.ymlfile already opts every other abstract generic out of the menu (DcimPhysicalDevice,DcimEndpoint,DcimConnector,DcimInterface,InterfaceLayer2/3, etc.).DcimGenericDevicewas the lone exception. The optical_transport generics followed the same anti-pattern. Both commits bring those generics in line with the established convention.What was deliberately left alone
Generics whose descendants nest under them via
menu_placement(e.g.ClusterGeneric,LocationGeneric,OrganizationGeneric,DcimGenericSFP,DcimGenericOadmInterface,DcimGenericPatchPanelInterface,NetworkManagementServer,TopologyNetworkStrategy) act as real menu parents and must stay visible.One mixed case remains —
DeviceGenericModuleinextensions/modules/modules.yml— where some descendants nest correctly and others (DeviceRoutingEngine,DcimTransponderModule) don't. That's a design call rather than a one-line fix; not addressed here.Direction this points toward
These changes are tactical fixes against the current
include_in_menu-driven model. The stated goal is to have menus driven bymenu.ymlfiles instead, at which pointinclude_in_menu: falsewould become the default for all abstract generics and explicit menu placement would live in the menu file. These two commits are a step in that direction without yet introducing the menu-file scaffolding.